import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

// 登录路由
import Login from '@/components/Login'
// 主页路由
import Home from '@/components/Home'

//首页路由
import Index from '@/views/Index'

// 车辆管理路由
import CarHub from '@/views/CarHub'

// 车位管理路由
import PlaceHub from '@/views/PlaceHub'

// 会员管理路由
import MemberHub from '@/views/MemberHub'

// 订单管理路由
import OrderHub from '@/views/OrderHub'

// 金额管理路由
import TotalHub from '@/views/TotalHub'

// 操作日记路由
import LogHub from '@/views/LogHub'

//车牌识别路由
import PlateHub from '@/views/PlateHub'

//车牌图片识别路由
import PtgImg from '@/views/PtgImg'

const routes = [
  { path: '/', redirect: '/login' },
  { path: '/login', component: Login },
  {
    path: '/home', component: Home,
    children: [
      { path: '/index', component: Index },
      { path: '/carhub', component: CarHub },
      { path: '/memberhub', component: MemberHub },
      { path: '/placehub', component: PlaceHub },
      { path: '/orderhub', component: OrderHub },
      { path: '/totalhub', component: TotalHub },
      { path: '/loghub', component: LogHub },
      { path: '/platehub', component: PlateHub },
      { path: '/ptgimg', component: PtgImg },
    ]
  },
]

const router = new VueRouter({
  routes
})

export default router
